package com.tecnoagrosoft.zafra.control.utils;

import com.tecnoagrosoft.zafra.control.activity.fragment.AplicacionFragment;
import com.tecnoagrosoft.zafra.control.activity.fragment.HomeFragment;
import com.tecnoagrosoft.zafra.control.activity.fragment.MenuMain;
import com.tecnoagrosoft.zafra.control.activity.fragment.ParcelaFragment;
import com.tecnoagrosoft.zafra.control.activity.fragment.SeguimientoFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

public class ViewPagerAdapter extends FragmentStatePagerAdapter {
	 
    private final int PAGES = 5;
    private String[] titles={"Opciones", "  HOME  ","Parcelas", "Seguimiento","    Labores"};
 
    public ViewPagerAdapter(FragmentManager fm) {
        super(fm);
    }
    
 
   
    
    @Override
    public Fragment getItem(int position) {
    	
    	
    		switch (position) {
            
    			case 0:
    				return new MenuMain();
    			case 1:
    				return new HomeFragment();
    			case 2:
    				return new ParcelaFragment();
    			case 3:
    				return new SeguimientoFragment();
    			case 4:
    				return new AplicacionFragment();
    			default:
    				throw new IllegalArgumentException("The item position should be less or equal to:" + PAGES);
    		
    		
    	}
        
        
    }
 
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
 
    @Override
    public int getCount() {
        return PAGES;
    }

   

    
    
}